using UnityEngine;
using UnityEngine.UI;
using QFramework;
using UnityEngine.SceneManagement;
using QAssetBundle;

namespace ProjectSurviver
{
	public class UIGameStartPanelData : UIPanelData
	{
	}
	public partial class UIGameStartPanel : UIPanel, IController
	{
		protected override void OnInit(IUIData uiData = null)
		{
			mData = uiData as UIGameStartPanelData ?? new UIGameStartPanelData(); // 初始化数据
			
			Time.timeScale = 1.0f;
			BtnStartGame.onClick.AddListener(()=>
			{
				AudioKit.PlaySound(Sfx.BUTTONCLICK);
				Global.ResetData();
				this.CloseSelf();
				SceneManager.LoadScene("Game");
			});
			BtnCoinUpgrade.onClick.AddListener(()=>
			{
				AudioKit.PlaySound(Sfx.BUTTONCLICK);
				CoinUpgradePanel.Show();
			});

			BtnAchievement.onClick.AddListener(()=>
			{
				AudioKit.PlaySound(Sfx.BUTTONCLICK);
				AchievementPanel.Show();
			});

			this.GetSystem<CoinUpgradeSystem>().Say();
		}
		
		protected override void OnOpen(IUIData uiData = null)
		{
		}
		
		protected override void OnShow()
		{
		}
		
		protected override void OnHide()
		{
		}
		
		protected override void OnClose()
		{
		}

        public IArchitecture GetArchitecture()
        {
            return Global.Interface;
        }
    }
}
